package com.fc.test.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.fc.test.common.base.BaseService;
import com.fc.test.common.support.Convert;
import com.fc.test.mapper.auto.TAbbScanMapper;
import com.fc.test.model.auto.TAbbScan;
import com.fc.test.model.auto.TAbbScanExample;
import com.fc.test.model.custom.Tablepar;
import com.fc.test.util.SnowflakeIdWorker;

/**
 * Service
* @Title: TAbbScanService.java 
* @Package com.fc.test.entity 
* @author fuce
* @email 87766867@qq.com
* @date 2019-10-09 16:49:06  
 */
@Service
public class TAbbScanService implements BaseService<TAbbScan, TAbbScanExample>{
	@Autowired
	private TAbbScanMapper tAbbScanMapper;

	@Override
	public int deleteByPrimaryKey(String ids) {
		List<String> lista=Convert.toListStrArray(ids);
		TAbbScanExample example=new TAbbScanExample();
		example.createCriteria().andIdIn(lista);
		return tAbbScanMapper.deleteByExample(example);
	}
	
	
	@Override
	public TAbbScan selectByPrimaryKey(String id) {
		
		return tAbbScanMapper.selectByPrimaryKey(id);
	}

	
	@Override
	public int updateByPrimaryKeySelective(TAbbScan record) {
		return tAbbScanMapper.updateByPrimaryKeySelective(record);
	}
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(TAbbScan record) {
		//添加雪花主键id
		record.setId(SnowflakeIdWorker.getUUID());
		return tAbbScanMapper.insertSelective(record);
	}
	
	

	

	
	
	

	
	@Override
	public int updateByExampleSelective(TAbbScan record, TAbbScanExample example) {
		
		return tAbbScanMapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(TAbbScan record, TAbbScanExample example) {
		
		return tAbbScanMapper.updateByExample(record, example);
	}

	@Override
	public List<TAbbScan> selectByExample(TAbbScanExample example) {
		
		return tAbbScanMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(TAbbScanExample example) {
		
		return tAbbScanMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(TAbbScanExample example) {
		
		return tAbbScanMapper.deleteByExample(example);
	}


	public TAbbScan getSacnNum(){
		List<TAbbScan> list = tAbbScanMapper.getSacnNum();
		TAbbScan scan = list.get(0);
		return scan;
	}

}
